<template>
  <div class="info-box">
    <h2 class="title">{{list.title}}</h2>
    <p class="msg">
      <span class="time">时间: {{list.add_time | timeF}}</span>
      <span class="time">次数: {{list.click}}</span>
    </p>
    <hr>
    <div v-html="list.content"></div>
    <comment :id="id"></comment>
  </div>
</template>
<script>
import comment from '../common/comment'
export default {
  data() {
    return {
      id: this.$route.params.id,
      list: {}
    };
  },
  methods: {
    getList() {
      this.$http.get("api/getnew/" + this.id).then(res => {
        this.list = res.body.message[0];
      });
    }
  },
  created() {
    this.getList();
  },
  components: {
    comment
  }
};
</script>
<style lang="scss">
.info-box {
  padding: 0 3px;
  .title {
    font-size: 16px;
    color: red;
    text-align: center;
  }
  .msg {
    justify-content: space-between;
    display: flex;
    margin: 3px;
  }
  hr {
    margin: 5px 0;
  }
}
</style>